home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-20 / 940set.zip / 940SET.ASM next >
Assembly Source File  |  1991-03-12  |  2KB  |  135 lines

  1. ; *****************************************************************************
  2. ;     TS-940/TS-790 remote control programm for IBM-PC/AT/XT
  3. ;            by   Southern NET
  4. ;                JA6FTL JG6MCG JF6BXG JR6RRH
  5. ;     1988/05    IBM PC version 
  6. ;    1988/11 PC9801 version
  7. ;   INT14 handler(MBBIOS etc.) and MBMODE must be run before execute.
  8. ;   Com port 1-6(A-F) allowed.
  9. ;       Usage....... 940set_(port)_(parameter)(parameter)...
  10. ;       example      940set a FA00014073000;MD1;
  11. ;                    940set c FB00435078000;    =>set VFO-B 435.078MHz via COM3
  12. ;                    940set b mc103;            =>set memory channel 3 of bank1
  13. ; *****************************************************************************
  14.  
  15.  
  16. NUL    = 00h
  17. TAB    = 09h
  18. CR    = 0dh
  19. LF    = 0ah
  20. BEEP    = 07h
  21. error    = 1
  22. noerror    = 0
  23.  
  24. print    macro string
  25.     mov    ax,data
  26.     mov    ds,ax
  27.     lea    dx,string
  28.     mov    ah,09h
  29.     int    21h
  30.     endm
  31. putch    macro    ch
  32.     mov    dl,ch
  33.     mov    ah,02h
  34.     int    21h
  35.     endm
  36.  
  37. mg    group    code,data
  38. data    segment    
  39. no_cn        db    BEEP,"Not channel [A-F]$"
  40. cmd_e_msg    db    BEEP,"Commamd error! Usage:(channel) (parameter)(parameter)",CR,LF
  41.         db    "       example   940set_a_ch103;fa;$"
  42. no_bios        db    BEEP,"Not loaded MBBIOS$"
  43. data    ends
  44.  
  45.  
  46. code    segment        
  47.     assume    cs:code;ds:code
  48.     org    81h
  49. channel    label    byte
  50.     org    82h
  51. cmdline    label    byte
  52. start:
  53.     org    100h
  54. main    proc    near
  55.  
  56.     call     bios_chk    ; com bios exit ?
  57.  
  58.     mov    di,offset channel    
  59. argment:mov    al,[di]
  60.     cmp    al,CR
  61.     je    cmd_error    ;command error
  62.     cmp    al,' '
  63.     jne    port
  64.     add    di,1
  65.     loop    argment
  66. port:
  67.     push    ds
  68.     call    chk_ch        ;channel check
  69.     sub    al,'A'        ; get port idn
  70.     mov    ah,0
  71.     mov    bx,ax        ; CX is port idn
  72.     pop    ds
  73.     mov    di,offset cmdline
  74.     add    di,2
  75. get_cmd:
  76.     mov    al,[di]
  77.     add    di,1
  78.     cmp    al,CR
  79.     jz    end_p        ;end
  80.     cmp    al,' '        ; skip space
  81.     jz    get_cmd
  82.     call    toupr
  83.     call    outi
  84.     loop    get_cmd
  85. extprog:mov    al,0 
  86.     mov    ah,4ch
  87.     int    21h
  88. cmd_error:
  89.     print    cmd_e_msg
  90.     jmp    end_p
  91. chk_ch:                ;is channel A-F ?
  92.     
  93.     call    toupr        ; to upper
  94.     cmp    al,'A'
  95.     jl    no_cn_msg
  96.     cmp    al,'G'
  97.     jg    no_cn_msg
  98.     ret
  99. toupr:
  100.     cmp    al,'Z'
  101.     jl    not_small
  102.     sub    al,20h
  103. not_small:
  104.     ret
  105. no_cn_msg:            ;no channel msg
  106.     print    no_cn
  107. end_p:
  108.     mov    al,0        ; normal end
  109.     mov    ah,4ch
  110.     int    21h
  111. bios_chk:
  112.     mov    dx,00
  113.     mov    ah,04
  114.     int    14h
  115.     cmp    ax,0aa55h
  116.     jne    exit           ; bios not loaded
  117.     ret
  118. exit:
  119.     print     no_bios
  120.     jmp    end_p
  121. outi:    
  122.     push    bx
  123.     xor    dx,dx
  124.     mov    dx,bx        ; load port_idn
  125.     mov    ah,01h        ; serial out cmd for int 14
  126.     int    14h
  127.     pop    bx
  128.     ret
  129.     
  130. main    endp
  131.  
  132. code    ends
  133.     end    main
  134.  
  135.